import api from './config'

// 点赞相关接口
export const toggleLike = (articleId) => {
    return api.post(`/likes/${articleId}`)
}

export const checkLiked = (articleId) => {
    return api.get(`/likes/${articleId}`)
}

// 收藏相关接口
export const toggleFavorite = (articleId) => {
    return api.post(`/favorites/${articleId}`)
}

export const checkFavorited = (articleId) => {
    return api.get(`/favorites/${articleId}`)
}

// 评论相关接口
export const getComments = (articleId) => {
    return api.get(`/comments/article/${articleId}`)
}

export const addComment = (data) => {
    return api.post('/comments', data)
}

export const deleteComment = (commentId) => {
    return api.delete(`/comments/${commentId}`)
}